load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "configmodel",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "features": {
            "convert-matcher": ["sapling-pathmatcher"],
            "convert-path": ["sapling-util"],
            "convert-regex": ["regex"],
        },
        "lib": {"name": "configmodel"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "description": "Configuration types used by Sapling.",
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-configmodel",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    features = [
        "convert-matcher",
        "convert-path",
        "convert-regex",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:auto_impl",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:twox-hash",
        "//eden/scm/lib/minibytes:minibytes",
        "//eden/scm/lib/pathmatcher:pathmatcher",
        "//eden/scm/lib/util:util",
    ],
)
